﻿using System.Threading.Tasks;
using CommunityToolkit.Mvvm.Input;

namespace AvaloniaApplication1.ViewModels;

public partial class RegisterViewModel : ViewModelBase
{
    public string? Username { get; set; }

    public string? Email { get; set; }

    public string? Password { get; set; }
    
    [RelayCommand]
    private void OnLogin()
    {
        ViewModelLocator.Instance.ApplicationViewModel.GoToPage(ApplicationPage.Login);
    }

    [RelayCommand]
    private async Task OnRegisterAsync()
    {
        await RunCommandAsync(() => IsBusy, async () => { await Task.Delay(5000); });
    }
}
